package com.ssy.lingxi.marketing.model.constant;

import java.util.Arrays;

/**
 * 活动商品审核状态
 * @author yzc
 * @version 2.0.0
 * @date 2021/10/25
 */
public enum ActivityGoodsAuditStatusEnum {

    NO_AUDIT(0, "未审核"),
    REJECT(1, "审核不通过"),
    AGREE(2, "审核通过");

    private final Integer code;
    private final String message;

    ActivityGoodsAuditStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static String getMessage(Integer code) {
        ActivityGoodsAuditStatusEnum statusEnum = Arrays.stream(ActivityGoodsAuditStatusEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
        return statusEnum == null ? "" : statusEnum.getMessage();
    }
}
